﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace _02_ConcatenatesTwoTextFiles
{
    class ConcatenatesFiles
    {
        static void Main(string[] args)
        {
            StreamReader firstReader = new StreamReader("text01.txt");
            string firstText;
            using (firstReader)
            {
                firstText = firstReader.ReadToEnd();
            }
            StreamReader secondReader = new StreamReader("text02.txt");
            string secondText;
            using (firstReader)
            {
                secondText = secondReader.ReadToEnd();
            }
            StreamWriter resultWriter = new StreamWriter("resultText.txt");
            using (resultWriter)
            {
                resultWriter.WriteLine(firstText);
                resultWriter.WriteLine(secondText);
            }
        }
    }
}
